package cn.besbing.server.cron;

import cn.besbing.server.service.primary.CronServiceImpl;
import com.alibaba.druid.util.StringUtils;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.scheduling.annotation.SchedulingConfigurer;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
import org.springframework.scheduling.support.CronTrigger;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

//@Component
public class singleThreadCron {

    Logger logger = LoggerFactory.getLogger(this.getClass());

    public class SaticScheduleTask {
        //3.添加定时任务
        @Scheduled(cron = "0 0 0 * * ?")
        //或直接指定时间间隔，例如：5秒
        //@Scheduled(fixedRate=5000)
        private void configureTasks() {
            //System.out.println("执行静态定时任务时间: " + LocalDateTime.now());
            logger.info("执行静态定时任务时间: {}",LocalDateTime.now());
        }
    }

}
